CREATE TABLE [dbo].[TDCAJA_CTCO]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CAJA] [dbo].[TD_VC_008] NOT NULL,
[AA_CAJA] [dbo].[TD_VC_004] NOT NULL,
[MM_CAJA] [dbo].[TD_VC_002] NOT NULL,
[TI_MOVI] [dbo].[TD_VC_001] NOT NULL,
[NU_COMP_CAJA] [dbo].[TD_VC_008] NOT NULL,
[NU_PLAC] [dbo].[TD_VC_200] NOT NULL,
[CO_TIPO_ENTI] [dbo].[TD_VC_001] NOT NULL,
[CO_ENTI] [dbo].[TD_VC_020] NOT NULL,
[DE_ENTI] [dbo].[TD_VC_100] NOT NULL,
[NU_KILO_ANTE] [dbo].[TD_VC_010] NULL,
[NU_KILO_RECO] [dbo].[TD_VC_010] NULL,
[DE_DOCU] [dbo].[TD_VC_050] NOT NULL,
[IM_VEHI] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCAJA_CT__IM_VE__1EF99443] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCAJA_CT__CO_US__1FEDB87C] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCAJA_CT__FE_US__20E1DCB5] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCAJA_CT__CO_US__21D600EE] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCAJA_CT__FE_US__22CA2527] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCAJA_CTCO] ADD CONSTRAINT [PK__TDCAJA_C__A6EE84677ED7A8CB] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA], [NU_PLAC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCAJA_CTCO] ADD CONSTRAINT [FK__TDCAJA_CTCO__2D7D891B] FOREIGN KEY ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA]) REFERENCES [dbo].[TCMOVI_CAJA] ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA])
GO
ALTER TABLE [dbo].[TDCAJA_CTCO] ADD CONSTRAINT [FK__TDCAJA_CTCO__2C8964E2] FOREIGN KEY ([CO_EMPR], [NU_PLAC]) REFERENCES [dbo].[TTVEHI] ([CO_EMPR], [NU_PLAC])
GO
